package com.xzh.service.impl;

import com.xzh.dao.CourseDao;
import com.xzh.model.search.CourseSearch;
import com.xzh.service.CoursService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CoursServiceImpl implements CoursService {
    private CourseDao courseDao;
    @Autowired
    public void setCourseDao(CourseDao courseDao) {
        this.courseDao = courseDao;
    }

    @Cacheable(value = "courseList", key = "'allCourses'")
    @Override
    public List<CourseSearch> selectList() {
        return courseDao.selectList();
    }
}
